package com.dmwork.service.work.feign;

import com.dmwork.common.base.result.R;
import com.dmwork.service.work.feign.impl.WorkCollectFeignServiceFallback;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Service
@FeignClient(value = "service-interaction-center", fallback = WorkCollectFeignServiceFallback.class)
public interface WorkCollectFeignService {

    @GetMapping("/front/dm_work/interaction/collect/get_work_id_list/{customerId}/{collectGroupId}/{page}/{limit}")
    R getWorkIdList(
            @PathVariable("customerId") String customerId,
            @PathVariable("collectGroupId") String collectGroupId,
            @PathVariable("page") Integer page,
            @PathVariable("limit") Integer limit);

    @GetMapping("/front/dm_work/interaction/collect/me/check_work_is_collected/{workId}")
    R checkWorkIsCollected(@PathVariable("workId") String workId);

    @ApiOperation("获取作品的被收藏数")
    @GetMapping("/front/dm_work/interaction/collect/feign/get_collect_count_by_work_id/{workId}")
    Integer getCollectCountByWorkId(@PathVariable("workId") String workId);

    @ApiOperation("批量获取多个作品的被收藏数")
    @GetMapping("/front/dm_work/interaction/collect/feign/get_batch_collect_count_by_work_id")
    Map<String, Integer> getBatchCollectCountByWorkIdList(@RequestParam("workIdList") List<String> workIdList);

}
